#include <bits/stdc++.h>
#define ll long long
using namespace std;
inline ll ksm(ll a,ll b,ll mod){
	ll z=1;
	while(b){
	if(b&1) z=z*a%mod;
	a=a*a%mod;
		b>>=1;
	}
	return z;
}
const int Mod=998244353;
const ll inv=ksm(6,Mod-2,Mod);
int m;
int x;
ll a,b;



inline ll Get1(ll n){
	return n*(n-1)/2%Mod;
}
inline ll Get2(ll n){
	return n*(n-1)%Mod*(n-2)%Mod*inv%Mod;
}

int main(){
	freopen("clown.in","r",stdin);
	freopen("clown.out","w",stdout);
    cin>>m;
    for(int i=1;i<=m;i++) cin>>x;
    cin>>a>>b;
    ll ans=Get2(a)*Get1(b)%Mod*36%Mod;
	ans=(ans+Get1(a)*Get2(b)%Mod*36%Mod)%Mod;
	ans=(ans+Get1(a)*Get1(b)%Mod*24%Mod)%Mod;
	ans=(ans+Get2(a)*Get2(b)%Mod*36%Mod)%Mod;
	printf("%lld",ans);
	
    return 0;
}
